package com.hqully.smartfumehood.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hqully.smartfumehood.entity.Role;

/**
 * The interface Role mapper.
 *
 * @author ZH.ming
 * @description 针对表 【role】的数据库操作Mapper
 * @createDate 2022 -03-13 09:56:58
 * @Entity .entity.com.hqully.labmanage.entity.Role
 */
/**
 * <p>
 *     针对数据库表[role]的操作
 * </p>
 * @entity {@link Role}
 * @author liulingyu <br>
 * @date 2022-05-12 17:38 <br>
 * @version 1.0
 */
@Mapper
public interface RoleMapper extends BaseMapper<Role> {

    /**
     * <p>
     *     根据[id]查询角色
     * </p>
     * @date 2022/5/12 17:38 <br>
     * @author liulingyu <br>
     * @param id 用户ID
     * @return {@link Role} 角色对象
     */
    Role findRoleById(@Param("id") Integer id);

    /**
     * <p>
     *     根据[id]查询用户名
     * </p>
     * @date 2022/5/12 17:39 <br>
     * @author liulingyu <br>
     * @param id 用户ID
     * @return {@link String} 用户名
     */
    String findNameById(@Param("id") Integer id);

    /**
     * <p>
     *     根据[userId]查询角色ID
     * </p>
     * @date 2022/5/12 17:40 <br>
     * @author liulingyu <br>
     * @param userId 用户ID
     * @return {@link Integer} 角色ID
     */
    Integer findRoleIdByUserId(@Param("userId") String userId);




}




